package com.hanhai.common.util;

import org.apache.log4j.Logger;

public class PageHelper {
	private static Logger logger = Logger.getLogger(PageHelper.class);

	public static void startPage(Integer pageNum, Integer pageSize) {
		startPage(pageNum, pageSize, true);
	}

	public static void startPage(Integer pageNum, Integer pageSize,
			boolean count) {
		if (pageNum == null || pageNum < 0) {
			logger.error("PageNum is illegal:"+pageNum);
			pageNum = 1;
		}
		if (pageSize == null || pageSize < 0) {
			logger.error("pageSize is illegal:"+pageNum);
			pageSize = 20;
		}
		com.github.pagehelper.PageHelper.startPage(pageNum, pageSize, count);
	}
}
